package com.tao.mapper;

import com.tao.entity.Weibo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
    @Insert("insert weibo values(null,#{content},#{url},#{createTime})")
    void insert(Weibo weibo);
    @Select("select * from weibo")
    List<Weibo> select();
    @Select("select url from weibo where id=#{id}")
    String selectUrlById(int id);
    @Delete("delete from weibo where id =#{id}")
    void delete(int id);
    @Select("select * from weibo where id = #{id}")
    Weibo selectById(int id);
    @Update("update weibo set content=#{content},url=#{url},createTime=#{createTime} where id=#{id}")
    void update(Weibo weibo);
}
